<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="s" uri="strutsTags"%>
<%@taglib prefix="ty" uri="/wyzzTags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<head>
	<base href="<%=basePath%>">
	<jsp:include flush="true" page="../sitemesh/jsPackage.jsp"></jsp:include>
	<link href="resource/css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/JavaScript" src="resource/js/hrm/profile.js"></script>
	<title>搜索档案</title>
</head>
<body onload="hrm.common.check_order();">
	<form action="profile/listContract.action" id="listForm" method="post">
		<table width="100%" class="formtable">
			<tr>
				<s:textfield label="员工" id="employeeId" name="employeeId" size="16"
					maxlength="64" />
				<s:select label="合同种类" name="empTypeId" list="empTypeList"
					listKey="id" listValue="ectName" multiple="false"
					emptyOption="true" />
				<td align="right">
					起始日期:
				</td>
				<td>
					<s:textfield id="ectStartDate" name="ectStartDate" size="10"
						maxlength="10" />
					<img onclick="WdatePicker({el:'ectStartDate'})" class="dateimg"
						src="resource/js/My97DatePicker/skin/datePicker.gif">
					到
					<s:textfield id="ectStartDateTo" name="ectStartDateTo" size="10"
						maxlength="10" />
					<img onclick="WdatePicker({el:'ectStartDateTo'})" class="dateimg"
						src="resource/js/My97DatePicker/skin/datePicker.gif">
				</td>
				<td rowspan="3" align="left">
					<input title="[Alt+F]" accesskey="F" name="submit_search"
						id="submit_search" class="button" type="submit" value="查询">
					<input title="[Alt+A]" accesskey="A" name="submit_all"
						id="submit_all" class="button" type="reset" value="重置"
						onclick="window.location='listContract.action'">
				</td>
			</tr>
			<tr>
				<td align="right">
					组织单元:
				</td>
				<td>
					<s:orgselector id="orgselector1" name="departmentName"
						hiddenFieldName="departmentId" isShowDisable="show" />
				</td>
				<s:select label="合同期限" name="etcExpire"
					list="#{'':'请选择','0':'有限期','1':'无限期'}" />
				<td align="right">
					结束日期:
				</td>
				<td>
					<s:textfield id="ectEndDate" name="ectEndDate" size="10"
						maxlength="10" />
					<img onclick="WdatePicker({el:'ectEndDate'})" class="dateimg"
						src="resource/js/My97DatePicker/skin/datePicker.gif">
					到
					<s:textfield id="ectEndDateTo" name="ectEndDateTo" size="10"
						maxlength="10" />
					<img onclick="WdatePicker({el:'ectEndDateTo'})" class="dateimg"
						src="resource/js/My97DatePicker/skin/datePicker.gif">
				</td>
			</tr>
			<tr>
				<s:textfield id="ectNo" label="合同编号" name="ectNo" size="16"
					maxlength="64" />
				<s:select label="合同状态" name="ectStatus"
					list="#{'':'请选择','1':'有效','2':'终止','3':'解除'}" />
				<s:textfield label="合同备注" id="ectComments" name="ectComments"
					size="20" maxlength="128" />
			</tr>
		</table>

		<!-- 操作 -->
		<div class="operatediv">
			<input type="hidden" name="searchOrExport" id="searchOrExport" />
			<s:hidden id="output-ommId" name="outmatchModelId" />
			<s:hidden id="output-ioName" name="outputIoName" />
			<span class="operatedivleft"> <ty:auth auths="101,2 or 101 3">
					<input class="button" type="button"
						onclick="initDivImmUpload('IEmpContract');" value="数据导入" />
					<input class="button" type="button" id="btnOutput" value="数据导出"
						onclick="HRMCommon.export_check('export');" />
				</ty:auth> </span>
			<span class="operatedivright">本次查询共得到<s:property
					value="page.totalRows" />条人事合同记录</span>
		</div>

		<table cellpadding="0" cellspacing="0" width="100%" border="0"
			class="gridtableList">
			<s:hidden id="order" name="page.order" />
			<s:hidden id="operate" name="page.operate" />
			<s:hidden id="page.currentPage" name="page.currentPage" />
			<tr>
				<th nowrap="nowrap">
					<a
						onclick="hrm.common.order_submit('emp.empDistinctNo', 'listForm');">员工编号</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='emp.empDistinctNo_img'>
				</th>
				<th nowrap="nowrap">
					<a onclick="hrm.common.order_submit('emp.empName', 'listForm');">员工姓名</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='emp.empName_img'>
				</th>
				<th nowrap="nowrap">
					<a onclick="hrm.common.order_submit('ectStatus', 'listForm');">状态</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='ectStatus_img'>
				</th>
				<th nowrap="nowrap">
					<a onclick="hrm.common.order_submit('ectStartDate', 'listForm');">起始日期</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='ectStartDate_img'>
				</th>
				<th nowrap="nowrap">
					<a onclick="hrm.common.order_submit('ectEndDate', 'listForm');">结束日期</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='ectEndDate_img'>
				</th>
				<th nowrap="nowrap">
					<a onclick="hrm.common.order_submit('ectNo', 'listForm');">合同编号</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='ectNo_img'>
				</th>
				<th nowrap="nowrap">
					<a
						onclick="hrm.common.order_submit('contractType.ectName', 'listForm');">合同种类</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='contractType.ectName_img'>
				</th>
				<th nowrap="nowrap">
					<a onclick="hrm.common.order_submit('etcExpire', 'listForm');">合同期限</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='etcExpire_img'>
				</th>
				<th nowrap="nowrap">
					<a onclick="hrm.common.order_submit('ectComments', 'listForm');">备注</a>
					<img src='resource/images/arrow_.gif' width='8' height='10'
						id='ectComments_img'>
				</th>
				<th>
					附件
				</th>
			</tr>
			<tbody>
				<s:if test="!contractList.isEmpty()">
					<s:iterator value="contractList">
						<tr id="<s:property value='ectId'/>">
							<td nowrap="nowrap">
								<s:property value="employee.empDistinctNo" />
							</td>
							<td nowrap="nowrap">
								<s:property value="employee.empName" />
							</td>
							<td nowrap="nowrap">
								<s:if test="ectStatus==1">有效</s:if>
								<s:if test="ectStatus==2">终止</s:if>
								<s:if test="ectStatus==3">解除</s:if>
							</td>
							<td nowrap="nowrap">
								<s:date name="ectStartDate" format="yy-mm-dd" />
							</td>
							<td nowrap="nowrap">
								<s:date name="ectEndDate" format="yy-mm-dd" />
							</td>
							<td nowrap="nowrap">
								<s:property value="ectNo" />
							</td>
							<td nowrap="nowrap">
								<s:property value="contractType.ectName" />
							</td>
							<td nowrap="nowrap">
								<s:if test="etcExpire==0">有限期</s:if>
								<s:if test="etcExpire==1">无限期</s:if>
							</td>
							<td>
								<s:property value="ectComments" />
							</td>
							<td nowrap="nowrap" align="right">
								<s:if test="ectAttatchment!='' && ectAttatchment!=null">
									<a id="href_<s:property value='ectId'/>"
										href="downProfile.action?fileName=<s:property value="ectAttatchment"/>&contentDisposition=<s:property value="ectAttatchment"/>">
										<img src="resource/images/attachment.gif" /> </a>
									<input type="hidden" id="attach<s:property value="ectId"/>"
										value="<s:property value="ectAttatchment"/>" />
									<script type="text/javascript">
									var filename = '<s:property value="employee.empDistinctNo"/>'+"_";
									filename += '<s:property value="ectStartDate"/>'+"_";
									<s:if test="ectEndDate != null">
										filename += '<s:property value="ectEndDate"/>'+"_";
									</s:if>
									var exp = '<s:property value="etcExpire"/>';
									filename += (exp=='0')?'有限期':'无限期';
									var extend = '<s:property value="ectAttatchment"/>';
									filename += "."+extend.split('.')[1];
									var tmp = 'profile/downProfile.action?fileName=<s:property value="ectAttatchment"/>&contentDisposition=';
									document.getElementById("href_"+"<s:property value='ectId'/>").href = tmp + filename;
								</script>
								</s:if>
							</td>
						</tr>
					</s:iterator>
				</s:if>
				<s:else>
					<tr>
						<td colspan="12" align="center">
							无相关合同记录！
						</td>
					</tr>
				</s:else>
			</tbody>
		</table>
		<s:pager end="page.end" pageNo="page.currentPage"
			totalRows="page.totalRows" totalPages="page.totalPages"
			formId="listForm" start="page.start" />
	</form>
	<jsp:include flush="true" page="../io/div_omm_select.jsp"></jsp:include>
	<script type="text/javascript">
model.simple.setParentIFrameFull("IFrame1"); 
</script>
	<jsp:include flush="true" page="../io/div_upload.jsp"></jsp:include>
</body>
